import { defineStore } from 'pinia';

export const useUserStore = defineStore({
  id: 'user', // id必填，且需要唯一
  state: () => {
    return {
      name: '荒',
      scrollTop: 0
    };
  },
  actions: {
    updateName(name:string) {
      this.name = name;
    },
    updateScrollTop(scrollTop:number) {
      this.scrollTop = scrollTop;
    },
  },
});
